-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(custom-resources): add optional logging flag to AwsCustomResourceProps
#29596
Conversation
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request
. Additionally, if clarification is needed add Clarification Request
to a comment.
Signed-off-by: Francis <colifran@amazon.com>
775b2d2
to
0122e2d
Compare
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
AwsCustomResource
AwsCustomResource
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
Signed-off-by: Francis <colifran@amazon.com>
AwsCustomResource
AwsCustomResource
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
Signed-off-by: Francis <colifran@amazon.com>
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
AwsCustomResource
AwsCustomResourceProps
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure this is quite what we want here. Please see my comments inline.
/** | ||
* Inputs to configure the Lambda function response. | ||
*/ | ||
export interface RespondProps { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export interface RespondProps { | |
export interface ResponseProps { |
responseStatus: string; | ||
|
||
/** | ||
* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing docstring. What's reason
?
/** | ||
* API response data to include in the response. | ||
*/ | ||
data: any; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data
doesn't make very clear what this actually is.
* | ||
* @default false | ||
*/ | ||
readonly disableLogging?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple things in terms of this prop:
- What if we later want to allow for levels of logging or other logging settings? This doesn't really leave room for that possibility.
- A field that is defaulted to false and is named for the absence of something isn't typically the best way to name/default things.
Reason for this change
SDK v2 and v3 handlers for
AwsCustomResource
log the event object passed to the handler, API responses, and caught /uncaught errors. This can potentially result in logging sensitive information that a user may wish to hide. This PR introduces adisableLogging
flag that can be used to disable all logging configured in the SDK v2 and v3 handlers.Description of changes
Added a
disableLogging
flag to theAwsCustomResourceProps
interface. The value ofdisableLogging
is provided in the handler event object as aResourceProperty
. All logging is now logged conditionally based on the value of this property.Description of how you validated changes
disableLogging
set to true was addeddisableLogging
isfalse
by defaultdisableLogging
istrue
it is set correctly in the synthesized templateChecklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license